delete gen
add httpserver and rearrange code
add httpserver and rearrange code