switched from json storage to database