wrote a class to connect and interact with an external server