updating endpoint url in angular controllers