Added comments
Added docs
Fixed CSRF issue