added json parsing to api_request