fixed server and some unit-tests. needs to be fixed though