finish developing the framework of server, several bugs remained