Resolving promise with response