Stop Waiting for the Backend: How API Contracts Unlocked Parallel Development for Our Team
Moving from a “blocked” workflow to true parallel execution using the Design-First approach.
“Is the API ready yet?”
This used to be the most frequent question in our daily stand-ups.
Early in my career, my team and I worked in a way that felt intuitive but turned out to be inefficient. When a new feature design was approved, we would split up immediately. The Frontend team would start slicing the UI, and the Backend team would start building the logic and the database schema.
We worked in silos, fueled by assumptions. “I assume the backend will return an array here.” “I assume the property name will be isVerified.”
The problem? Frontend development — specifically slicing UI — is often faster than building complex backend logic.
The “Waiting Game” Trap
The Frontend team would usually finish the UI slicing in two days. But the Backend was still dealing with complex business logic, database optimizations, or third-party integrations.
The result? The Bottleneck.
The Frontend developer would sit idle, blocked. They couldn’t implement the data integration logic because the API didn’t exist yet. They couldn’t move to the next task easily because the current task was “half-done.”
And the worst part came during integration. Once the API was finally ready, we’d realize our assumptions were wrong.
- Frontend expected imageUrl, Backend sent avatar_url.
- Frontend expected a Boolean, Backend sent a String “true”.
We wasted hours fixing these mismatches. I realized we were essentially working in a Waterfall model disguised as Agile. We needed a change.
The Solution: Contract First, Code Later
We decided to flip the workflow. We introduced a mandatory step before writing a single line of code: The API Contract Discussion.
Now, before the sprint kicks off effectively, Frontend and Backend developers sit down (or hop on a call) to negotiate the “Source of Truth.”
We define everything upfront:
- The Endpoint: (e.g., GET /api/v1/users/profile)
- The Method: (GET, POST, PUT, etc.)
- The Response Body: Exact JSON structure, key names, and data types.
- Error Codes: What happens if something goes wrong?
We document this (using tools like Swagger/OpenAPI, or even a simple Notion doc). Once we agree, this document becomes the law.
The Magic: Parallel Development with Mocking
With the contract in hand, the bottleneck disappeared. The workflow shifted from Serial (Waiting) to Parallel (Executing).
Instead of waiting for the real API, I could immediately create a Mock Function based on the agreed contract.
I didn’t just return a static object. I used a Promise combined with setTimeout. This allowed me to simulate a real network request, including latency.
Here is how I implement the mock in the codebase:
// user.service.mock.js
// Based on the agreed API Contract
const getUserProfile = () => {
return new Promise((resolve, reject) => {
// Simulate network latency of 1 second
setTimeout(() => {
// Scenario A: Success
return resolve({
data: {
id: 'user-id123',
name: 'John Doe',
role: 'admin'
}
});
// Scenario B: Error (Uncomment to test error handling)
// return reject({
// response: { status: 500, code: 'INTERNAL_SERVER_ERROR' }
// });
}, 1000);
});
};
This approach gave me superpowers as a Frontend Developer:
- I can test Loading States: Because of the setTimeout, I can visually verify if my loading spinners or skeleton loaders work correctly during that 1-second delay.
- I can test Error Handling: I can easily simulate a failure by rejecting the promise, allowing me to build the error UI (e.g., Toast notifications or Error Boundaries) without needing the backend to actually crash.
- I can finish the feature: Logic-wise, the feature is complete. I can commit the code and move to the next task.
The Moment of Truth: Integration
The beauty of this approach is the integration phase.
When the Backend team finally says, “The API is ready,” the integration is effortless. Because we both followed the same blueprint, I simply swap my Mock function with the real API call.
- No “Undefined” errors.
- No “Key mismatch” drama.
- No reworking the UI logic.
It just works. Plug and play.
Conclusion
If your Frontend team is constantly asking “Is the API ready?”, you have a process problem, not a coding problem.
Moving to an API Contract-First approach didn’t just speed up our development; it reduced stress. It allowed us to work in parallel, respect each other’s time, and treat integration as a final verification rather than a bug-fixing session.
Don’t code on assumptions. Agree on the contract, mock the latency, and stop waiting.