Try a few times to connect to the API