Remove config constant and apiendpoint var