added web server function
fixed redundant things