As you are writing the headers in the same method, it does not have much sense use de_unicode_dict, we can remove both de_unicode methods from here (self.api_key has been already encoded).