modifications to handle exceptions better;
added "connectedness" to the REST API - rjrjr