' + encodeURIComponent(petId) + '/visits', {
		headers,
		method: 'GET'
	});
})
.then(response => {
	return response.json();
})
.then(visits => {
	console.log(visits);
	let tbodyEl = document.getElementById('visits-tbody');
	let html = '';
	for (let visit_id in visits) {
 	 	let visit = visits[visit_id];
 	 	html += '<tr><td>' + visit.visit_date + '</td><td>' + visit.description + '</td></tr>';
	}
	tbodyEl.innerHTML = html;
});

let formEl = document.getElementById('new-visit-form');
formEl.addEventListener