Changes for the new API.
Changes for the new api.