Fix UTF-8 Encoding bug, was causing HTTP 400 Bad Request when JSON contained characters longer than one byte