implement rest-prest cs-gen-Function, need test