update the API function