CRM-15674 - API rest code cleanup