CRM-13550 - API - Port 2nd patch from 4.2
CRM-13550 - API - apiv2 patch from 4.2
Merge pull request #1826 from colemanw/4.3

CRM-13550 - API - Port 2nd patch from 4.2