properly saving data in the database at game end and returd required json to update the page