MohitDecodes
Back to blogsBackend

REST API Design Mistakes Most Beginners Make

August 7, 2026 · 6 min read

An API can return the right data and still be badly designed. The bugs that ship are obvious; the design mistakes are the ones that make every integration with your API take longer than it should. Here are the ones that show up constantly in beginner projects.

1. Verbs in the URL

REST is resource-oriented: the URL names a *thing*, and the HTTP method says what you're doing to it.

// Wrong — the method already says "get"
GET /getUserById/42

// Right — the URL is the resource, GET is the verb
GET /users/42

This isn't pedantry — once the URL is just the resource, the same pattern works for every operation on it: `GET /users/42` to read, `PUT /users/42` to replace, `DELETE /users/42` to remove. One naming convention, four verbs, instead of `/getUser`, `/updateUser`, `/removeUser` as three unrelated endpoints.

2. Returning 200 for everything

Returning `200 OK` with `{ "error": "not found" }` in the body breaks every piece of tooling that checks the status code — HTTP clients, monitoring, retry logic, `fetch().ok`. The status code is part of the contract; use it.

  • 200 — success, returning data
  • 201 — success, a resource was created (return its URL in the Location header)
  • 400 — the client sent something invalid
  • 401 / 403 — not authenticated / not allowed
  • 404 — resource doesn't exist
  • 500 — the server broke, not the client's fault

3. Inconsistent response shapes

If `/users` returns `{ data: [...] }` but `/posts` returns a bare array, every client of your API has to special-case each endpoint. Pick one envelope shape (or no envelope) and use it everywhere.

4. No pagination on list endpoints

`GET /users` that returns all 40,000 rows works fine in dev with 12 test users and falls over in production. Even a simple `?page=1&limit=20` from day one saves you a breaking change later.

5. Skipping versioning

The first breaking change you make to a live API without versioning breaks every existing client instantly. `/api/v1/users` costs nothing to add up front and gives you a way to change `v2` without breaking anyone still on `v1`.

None of these require a framework or a library — they're naming and status-code discipline. That's exactly why they're worth fixing early: the cost of doing it right from the start is close to zero, and the cost of fixing it after clients depend on the wrong behavior is not.