Terminating server, saving final changes