Consolidate core API logic.