aded try/catch blocks to json parsing