delete folders and remove main from generate_dart_api

Also moved a bunch of functions to be private.