Added new error handler to policies API