Changed a bit the json exceptions handling