add doxygen content
add suitable targets for external projects
Update APIs error code, tests all APIs with CUNIT, fix bugs accordingly