Preserve warnings on API error

* In case of an error, any warnings generated by API modules before
the error will be preserved in the result.
* Spelling

Change-Id: Ib61a1da90e9ce5df60ceccd0de8c6de9e49a22d6
Merge "Preserve warnings on API error"