better json parsing (and an example of bad json parsing)