Implemented main api
Added doxygen docs
fixes