XHR and dependency injection