add restfull function