Starting to put together an API.
flush and commit after adding a chain.