add connectability-checking and logout features
add generic error handler