refactor functionality of get_all_by_election_id() into a parameterized get_all() method.