sort API classes into their corresponding subpackages.