Parse JSON data and output as CSV