Fix case where db.json does not exist, create empty db with correct structure.