Implement memcache backend and refactor the service