Fix for recent changes to errors handler in API

Use record_to_common_format instead of ['error']
Merge pull request #76 from eLobato/error_handler

Bug #4190 - Fix for recent changes to errors handler in API