Fix for recent changes to errors handler in API

Use record_to_common_format instead of ['error']