Reformat some API example code; fixes #234