replaced socket system with rest client