Modified the memcache class to fit unit-test