Refactored resource manager to queue ajax calls