add login mode, controller and XHR lib