The data collected is now converted into JSON and inserted into a JSON array