handles 401s from the server