Restructuring for new API library