corrections to get the endpoint url correct when calling command line script