In the past, testing was done only at the GUI level and at the end of the development process. When a developer finished their work, they handed it over to the quality assurance team. Because the engineers were short on time, they decided to test the code at the highest level possible: the GUI.
Testing at a ground level, such as the API level, is required in the Agile era. Even developers can do it on their own. API testing can even be done before development is finished, thanks to “API contracts.” This means that developers can use pre-written tests to validate their code.