Javascript API middleware that handles throttling, queuing, request deduplication, and arbitrary holds