Fixed a null pointer exception caused by being unable to connect to an API