I think you should add basic auth into self.get. Then you can call it for the private api as well as the public api and it will take care of the error handling.