Collecting and formatting changeset errors?

I either assign them to form elements if there is an HTML form, or just loop over the errors and assign to a map to give out to json for an API. Can you give some examples of what you are trying to do?