moving server communication to a service