Update to use api.Context