add callbacks and memcache support