Refactor some sensor/measurements fns from api -> data.