Update code samples according to current API (#85)

[ci skip]