improved api
added documentation