Refactored some of the API Library and wrote a tonne of documentation