public void FetchStatistics(IManosContext ctx, string id)
{
string json;
if (store.TryGetCachedStats (out json)) {
ctx.Response.HandleJson (json);
return;
}
var dict = new Dictionary<object, object> ();
int picCount, userCount;
store.GetCountStats (out picCount, out userCount);
dict["picNumber"] = picCount;
dict["userNumber"] = userCount;
dict["latestPics"] = store.GetLastPicturesIds ().Cast<object> ().ToList ();
json = JSON.JsonEncode (dict);
store.SetCachedStats (json);
ctx.Response.HandleJson (json);
}