add close method for server object