@seventopo in case you have your business logic in a separate layer, like services or repositories then you will again need to create different endpoints in the api.php file in this case, and they will be served by different controllers, as they will need to return a JSON representation of the data, and not a blade view.
But if you have everything in the controller, like the calls to your database and so on.. then the easiest thing is to check on the request:
$users = User::all();
if($request->wantsJson())
{
return $users;
}
return view('users.index', ['users' => $users]);
This is just a simple example, but I would suggest you go with the first point, creating separate routes and separate controllers, but having your business logic in a separate layer as well.