try catch around json parsing