created a generic api