Remove legacy things, add export to api