Cache promises instead of results in API
Move out endpoint implementation to middlewares