prepare in API mode