Updated API ref docs with improvements.

some minor documentation fixes.

Some improvements to the API reference examples.

Updated API ref docs with improvements.