updated the measurements api to not check token twice