Fixed bug for conditional in API.