CMS-2539 Figure out better error handling in REST API