Rework database, set up to store json file