hacky fix
put everything in root to avoid chdir
move all config into flags, clean up routes
add more debugging and return after every 500