move to the api package
tidy up