client.py/test_client.py: bugfix and interface cleanup