refs #2: new example file
refs #2: make APIs consistent, add logging