Add error handler for server