Played around some more with the JSON parsing. Had to some regular expression replacement to get this working because the JSON had some bad escape characters.