defined generic api call