[front-end, docs] Write docs for most widgetApi stuff.

Use prototype-based methods in APIProvider, APIUser, EventPublisher