refactor static server; add some APIs