add ability to set api endpoint for tests
one api endpoint instead of 3 parts to facilitiate changing the url during tests