[Geoserver-users] Question about GeoServer API

Hello, I have a question about how GeoServer API works.

I’d like to create an set of WSM for displaying a map with demography information related to it. I have demography information related counties and provinces by year. What I would like is to provide the ability of creating specific queries. For example:
Query: How many deaths by Male|Female on 2010 in the province A? The user will use OpenLayers on the client side.

Response: Province A displayed on the map with the information of deaths for M|F on 2010.

I already know how to create charts on the map so, I can display the information nicely.

The main question is how does geoserver work? Can I do this? Is there any example that you guys know?

I really appreciate any help.

Thanks,