Add new function: register and login, use namespace now