Adding a handler for uncaught exceptions in the server

making it easier to debug and work with endpoint errors, and hopefully
will also surface some errors on the server itself