updated samples to new API signatures