error when connecting to the API