Server now reacts more intelligently to requests. Made testcli more robust.