adding 401 (Unauthorized) support to the library