function to create json files