Modified models to refelct the db and added json parsing