code: function toggleRecording() {
              mockService.toggleRecord({}, function (response) {
                  vm.record = response.record;
                  if (vm.record) {
                      interval = $interval(refreshMocks, 5000);
                  } else {
                      $interval.cancel(interval);
                      refreshMocks();
                  }
              });
          }
docs: Toggle the recording.