Small API fixes, added documentation