code to add data to json file