PLAT-4506 - JSON serialization of errors, better error messages