update query interface in markup, reorganize simple-server template code