add some command line stuff and start on webapi refactor