Added function to generate json files