move legacy api to its own module