TODO: improve.

For now, see examples in python api repo