Added API documentation 

Also added reference to (optional) variables