Further fixes to tests/api.py interaction.