wrapper with memcached code to manage cache in the queries