Modifications to return response as JSON from API calls