Addresses issue #5

Added connection states and validation of the connection before a
service can be opened.