Function created to turn json data into csv format.
Implemented functionaltiy to turn json data into csv format (viewable in excel).