Implement rate-limiting

Change-Id: I8121c5aa79fc0c8a09064ddb964ceb42878c7b21