add function to convert byte to str

+ fix "TypeError("the JSON object must be str, not 'bytes'")"