Added example of using APIException class.  Closes #1300