APIs
ideally should be designed in such a way as to make the most sense to the consumer. There is no really good reason to reflect your "server architecture" in general. In fact, this is what is commonly referred to as leaky abstraction or leaky API and is considered bad practice, mainly because your application structure may change, and then you have these possible scenarios:
- you need to change your API, which is a non-trivial task when it is already in use by someone;
- your API is no longer a reflection of the structure of your application, which leads to inconsistencies;
- Revealing the structure of the application or database schema in the world can have security implications.
Based on these considerations, you could also develop an API with emphasis on ease of use in the first place. The consumer of your API does not need to know or care about your application architecture.
source share