dependency injection for xhr, json