Modify REST based samples to use promises