Added CSRF protection

Added classes and methods to protect against CSRF attacks