update output flag to use directory and default filename to endpoint name