Added code to turn input data into JSON.