Created a function to read the JSON object