title: Designing REST api for returning count of multiple objects
body: <p>I have a question on how should I design my rest api(s) given that I need to return count of different objects in my application. There are multiple approaches that could be thought off</p>
  
  <ol>
  <li><p>Defining a single api that generally accepts the object identifier in the request body (json) and returns back the count for each of the object identifiers in the response. The drawback is the api is too generic and possibly not restful since there is no resource. The url would look like GET /counts</p></li>
  <li><p>Define individual api's for each of the resources for which count is needed. Assuming I need to return counts for the fields defined in the software, tables, processes, tasks, jobs etc I would define individual api's for each of these resources. It would look like GET /field/count or GET /table/count. A side effect of this would be there would be many web api's for each of the resources we need the count for. Is that bad?</p></li>
  </ol>
  
  <p>Kindly share your thoughts on the above approaches and any new ways in which I could design such an API that adheres to the REST standards.</p>
  
  <p>Thanks</p>