storing json to database