Refactored the error handling with target event and updated the rest calls so they are consistent with other rest calls in the application.