Danuta, approach Anton suggested would work, however there are other ways to get it without using API:
for example you could implement custom query for your custom table, that will retrieve questions + count of answers for each question. Having this data you could easily present it on the page using repeater with custom query.