More documentation.

More API documentation added.
Also, removed some code which was not being used.
No functions were removed, only have removed un-used variables and one instance of a variable being assigned to itself.