implementing client and testing server, server now can handler register