JSON error message, strengthened authentication check