Handling non-unicode strings in endpoint decorator