server: add unit tests

Make test coverage >= 90%

#1019 
I actually don't think `LocalAction` is too bad. Add a short docstring and I think it's fine.
`// Test commands which do not need to go through raft to be applied`

How else would you guys describe it?