an attempt at Promises in Swift