Added logout action, make ajax send data with csrf.