refactor(server.go) change server.stopped a chan of chan
It is a clean way to do a sync between a function call and a goroutine.