parse a json file from a api call to csv