Fixed server response with a flush. Added full test involving both
server and client.