new class to handle connections to server