improving test server
refactoring sendall