move most of the API URL stuff in to api_config_init()