Use Promises to connect to rest service