Clean up server interface and return useful errors.