refactored Server and added tests.
added support for invalidating a server.