Update api.py

Handle silly autodiscover.