Design and implement a simple rate-limiter for an internal API endpoint, explaining your trade-offs as we code.