Added caching, storing to db; Added models and test