Added shutdown functionality to the server.