Resolve the error "TypeError: the JSON object must be str, not 'bytes'"

The type `bytes` cannot be converted automatically to `str` by `json.loads` on Python 3.
This patch fixes this issue. 

(Please) Feel free to comment on my first contribute. :smile: