update sample for latest api