beautified
move dispatch code to own function
fix braces
readd simple webserver temporarly