Agree the API contract before writing either side

The cheapest moment to discover that two people meant different things is before either of them has built it.