add generic file api