Better handling for not connecting or json decodeerro