New API and tests