Wrap JSON call in try/catch block