handle api  correctly.