Implement a rate limiting middleware

I'm fairly sure there is a middleware we can just apply, mentioned in the FastAPI docs.