Change the json generation code