Fix logging exception after running self.login in call_api