Function `perform_request` now returns the JSON response.