modified error handlers, and made server handle messages better