Add server shutdown function