server: add unit tests

Make test coverage >= 90%

#1019 
append(w.action, fmt.Sprintf("%s%d","r",id)))