added documentation for most of the API