How API rate limiting works, and 2 implementation examples in FastAPI