CRM-14355 fix api to accept empty limit as unlimited