Fixing Server does not close properly

Server is now closeable and no the thread can be removed.