CRM-11923 - generate:api - Create _spec function