New set of APIs for buffer capture
Make code compilable
Fix facility...