add function for sorting apis based on dependency between their variables set