better use of memcache api for caching