Modify "CSRF" filter.

Check authenticity and return JSON response.