Added decoding, fixed typo in json.loads