Added more functionaility. Refactored the API interfaces.