Fix JSON objects being turned into strings incorrectly
Add test for JSON parsing