created NOAPI+CommonErrors.h and added more documentation