added error_style config option to get JSON error messages