Writing high level API for command stream
Updated demo to use new API