Created class to check connections before connect to the web service