added generic api calling