Hacked together some stuff to get terms with metrics to server side. Needs cleaning, but it works.