implement all the login and register part of server side, with junit tested