setmimetype test completed, webserver code refactored