add api_url() to the agent model