Resources can be nested depending on the architecture of the application. In our case, we need to load contacts in the sidebar before displaying any of them to the user. Therefore, we need to define the contact resource inside the contacts. On the other hand, in an application such as Twitter, it won't make sense to define a
tweet resource embedded inside a
tweets resource because an extra overhead will be incurred when a user just wants to view a single tweet linked from an external application.