added helper api call method to reduce duplicated code