Function for implementing counters via appengine.