Move JSON resource into a factory service