Updated to work with new variables endpoints