Cleaned up exception handling on the server side.

* Removed a bunch of catch-alls and added slightly more fine grained
  exception handling.
* Added logging for several errors