Updated the handling of different mimetypes for py3k api