update to call_api_function