Improved logging of api connection errors