added some unit tests for server logic