added close methods to server class