Fixed bug with crash when API key is invalid or unable to connect