Full fix for the api v2
Merge pull request #49 from cividesk/CRM-13550

CRM-13550 Improve validation of options in the api