Carousel is converting into dropdown , when api response objects exceeds in number

I have created a carousel with dynamic data coming from an API. The carousel is displayed as expected when there’s a small set of data returned by the API. But as the data exceeds , it automatically converts into dropdown.
How to prevent this behavior.
Can we put a limit in the number of data displayed in carousel/dropdown even when the API is returning whole set of data.
Kindly suggest a solution.