Run the shutdown method on closing of the application
Add exceptions to the server so it shuts down correctly