reestructured server module and added http client for tests