raise exception when the api url to request is not defined