Pgb api

API doc, mostly cleaned up but not yet ready for display