Changed logic to call onResolved/onRejected to more accurately handle returned data from the call