restructured the api