Only respond to with JSON when checking security validity