Further work on new API (WIP).