moved code around so the visualization controller only deals with api calls and election controller only deals with serving html. Reworked api calls and added correct error handling to them.