moved server communication methods to new class