add settings API and test code