Implement rate-limiting

http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#rate-limiting
move this comment above ``$rate_limit_entity = entity_create..``