Changed onSuccess callback to return API result.