sort apis when parsing the problem, using variables dependency