Implement basics for closing the server cleanly
working cli for server