add app manager API and test code