Fixed NullPointer if connection to REST API is refused or host is unreachable