Added CSRF protection and started working on flashing