How to find reference errors in a document using the API

I need to detect errors in documents using the API. The kinds of errors I am interested in detecting are:

  1. Broken references
  2. Missing references
  3. Features with errors
  4. Broken mates
  5. Configurations with issues

Basically anything that could potentially cause the model to change if the model and it's components (if any) were working correctly.

I need to do this for all three types of files (parts, assemblies and documents)

I do not see any member in IModelDoc2, AssemblyDoc or PartDoc that shows or gets errors. I assume one has to iterate the features, components themselves to check for error codes? 

I thought I could do this with Document Manager but it does not look like it is that simple.

Any direction or help on this would be appreciated.

SolidworksApi/macros