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

This should be merged when https://github.com/theforeman/foreman/pull/1180 gets merged.