Catch errors for server. Fixes #61