add restfull server function