Fixed error in api.py

As described in the issue I posted yesterday, there was an error in api.py. It was a one line change to fix it.