New API, still work in progress.