added authorization helper and 401 error