[ajax] added decorator 'login_required_ajax', improved ajax related code, removed 'client_mgmt'
Fix a few bugs