Cleanup on api.js

Replaced all tabs with spaces; removed foo (literally).