exception handling on fetching json