For a long time, I thought building APIs meant writing endpoints.
You know the pattern:
Define a route
Validate input
Query the database
Transform the result
Send a response
Do that over and over again.
Different routes. Same structure.
The Illusion of Control
Writing endpoints feels productive.
You’re in control of everything:
The logic
The validation
The data flow
But after a while, something becomes obvious:
You’re not building systems.
You’re repeating patterns.
The Real Problem
Most APIs look like this:
app . get ( ' /users/:id ' , async ( req , res ) => { const id = req . params . id ;
if ( ! id ) { return res . status ( 400 ). json ({ error : ' Missing id ' }); }
const user = await db . users . findById ( id );
if ( ! user ) { return res . status ( 404 ). json ({ error : ' Not found ' }); }
return res .…