Remove legacy promises from api.js