First working prototype. TODO: memcache