Added try catch to JSON parsing.