refactored metric api commands to use command line options rather than sys arguments