Introduce get_api_response to be more dry.