Move label creation out of backend and into js