Move most of api code into boatd package