Isolate json parsing in try catch