Changing flush mechanism to use GAE DeferredTask