Updates to ApiErrorMessage for error reporting. Minor housekeeping.