clean dep and add headers in rest session