finished api refactor; added inline documentation