restructure to have a more resource-ful api client