api fix compile errors in samples