title: In RESTful API, Are Resources need to be directly in relation to domain models?
body: <p>Consider I have a User resource on database and it contains a list of Addresses with in it.</p>
  
  <pre><code>GET /users -&gt; Returns list of users
  [
    {
      "name":"Rick",
      "email":"abc@example.com,
      "addresses":[
        "home" : {
                    ....  
                  },
        "work" : {
                    ...
                 }
      ]
    }
  ]
  </code></pre>
  
  <p>Here addresses is a part of User resource. Now when designing api for CRUD on addresses the below seems to be a of good structure.</p>
  
  <pre><code>GET /users/{user-id}/addresses
  POST /users/{user-id}/addresses
  </code></pre>
  
  <p>But i'm confused as addresses doesn't relate to a direct domain model on database. 
  So question is</p>
  
  <p>Are Resources need to be directly in relation with domain models? or above design is proper?</p>