Every endpoint is check-act-answer
An endpoint verifies its input (auth, signature, schema), performs exactly one action, and answers with a status and body. Keep that shape and an API is predictable. Skip the check and you have an endpoint that acts on untrusted input.
Design the status first
Before coding, decide what each failure returns: 400 for a bad body, 404 for a missing path, 409 for a conflict, 422 for a well-formed but wrong one. The status map is the contract; the code just fills it.