Fix bug in API example.