updates json and structure