Added a check to see if returned JSON is already object or not.