Where does the API fit in?
When you are creating a decoupled application, your principal parts are:
- The front end
- The back end
- The middleware
A typical front end might be a web application, a mobile application, or other ways of displaying data.
A typical backend might be a database or another service.
The middleware sits between the front end and the back end. The most important middleware is the API. The job of the API is to ensure that the front end and back end are decoupled – that is, you can modify one without affecting the other. This is simply good programming practice and will save you hours (or months) of rewriting should either of these change (which they will!).