Add exception catching for json parsing.