Offload work from client.py onto clientapi.py