generic api generator