Make tests/api_tests.py run on py3k

Change-Id: I919502ad8ed664c1f7a774d1a25c692041f11a57
Merge "Make tests/api_tests.py run on py3k"