add base server and fix corresponded bugs