added xsrf token implementation to prevent csrf and xsrf attacks