changes for json parsing and REST error capture