CRM-13550 Improve validation of options in the api

Full fix for the api v2