An API portion is the code that let's an outsider either get some data or updates / adds some data. Of course using a token.
It would be separate classes or at least methods involved for this.
See API Resources here: https://laravel.com/docs/9.x/eloquent-resources#main-content