title: RESTful API response for data transfer objects
body: <p>I have this following scenario in my application. I am logged in as a user and i create a group. There is a REST api for creating the group (POST /groups/api/v1/groups) and getting the group details (GET /groups/api/v1/groups/{group id})</p>
  
  <p>The response returned on success is not just the json representation of the group resource. Its a DTO which contains a lot of other information  (to avoid multiple calls to the server)</p>
  
  <p>For instance, the response can include</p>
  
  <ol>
  <li><p>Actions that can be performed on the group (for ex: inviting a user to the group) and the corresponding urls that need to be hit for each action</p></li>
  <li><p>Count of members in the group.</p></li>
  <li><p>Recent activity in the group</p></li>
  <li><p>Member information</p></li>
  </ol>
  
  <p>etc</p>
  
  <p>Right now the only client using the REST api's is the UI which needs additional information. If the APIs are exposed to developers later, they may not need all the information being returned. How do we handle rest responses in such scenarios where we have to return DTO's which contain more information?</p>
  
  <p>Is it a good design to be returning dto's in rest response for GET or should be avoided? </p>