update the API function and model