Added api_response function.