server: add unit tests

Make test coverage >= 90%

#1019 
Why does this even return an error if it's not used anywhere?