/id endpoint to return html if visited with a browser and JSON otherwise