Added check for http code 401 in GET