Finalize new API,  more examples

Also fix issue 9579.