remove trailing /api from endpoint url