Fix unicode api calls to add support for Python 2.7.