One idea
A route handler is a server endpoint made by adding route.ts inside the app folder. Use it when your browser UI, webhook, mobile client, or another service needs to call your app over HTTP.
Do not create an API route for every database read. In App Router, Server Components can fetch data directly on the server.
Where it fits
Your pages use page.tsx. Your layouts use layout.tsx. Your API endpoint uses route.ts.
The folder path becomes the URL. app/api/status/route.ts becomes /api/status. This is file-based routing, but for HTTP methods instead of screens.