debugging and try catch for json parsing