Implemented add function, documented API functions.