docs: function (operation, space, groupId, res) {
          if (!((operation.moveTo && operation.moveTo.space) ||
          (operation.transform && (operation.transform.scale || operation.transform.translate)))) {
              // An attempt to do something we don't understand
              log.error('Invalid Operation:', 'request:', JSON.stringify(operation));
              Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid operation' }));
          } else if (operation.moveTo && operation.moveTo.space && !server.spaces[operation.moveTo.space]) {
              log.error('Invalid Space', 'request:', JSON.stringify(operation));
              Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid space' }));
              return;
          } else if (operation.transform) {
              if (operation.transform.scale && (operation.transform.scale.x === undefined || operation.transform.scale.y === undefined)) {
                  log.error('Invalid Dimensions for Scale operation', 'request:', JSON.stringify(operation));
                  Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid dimensions' }));
                  return;
              } else if (operation.transform.translate && (operation.transform.translate.x === undefined || operation.transform.translate.y === undefined)) {
                  log.error('Invalid Dimensions for Translate operation', 'request:', JSON.stringify(operation));
                  Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid dimensions' }));
                  return;
              }
          }
  
          let sectionsToUpdate = [];
          const sections = server.state.get('sections');
          if (groupId) {
              if (!Utils.isNullOrEmpty(server.state.get('groups[' + groupId + ']'))) {
                  log.info('Updating sections of group:', groupId);
                  const group = server.state.get('groups[' + groupId + ']').slice();
                  group.forEach(function (e) {
                      let i = parseInt(e, 10);
                      sectionsToUpdate.push(i);
                  });
              }
          } else if (space) {
              log.info('Updating sections of space:', space);
              let i = -1;
              let findSectionsBySpace = function (e, x) {
                  return x > i && !Utils.isNullOrEmpty(e) && !Utils.isNullOrEmpty(e.spaces[space]);
              };
              i = sections.findIndex(findSectionsBySpace);
              while (i !== -1) {
                  sectionsToUpdate.push(i);
                  i = sections.findIndex(findSectionsBySpace);
              }
          } else {
              sections.forEach(function (e, i) {
                  if (!Utils.isNullOrEmpty(e)) {
                      sectionsToUpdate.push(i);
                  }
              });
          }
  
          // Check whether any operation has to be made.
          if (Utils.isNullOrEmpty(sectionsToUpdate)) {
              Utils.sendEmptySuccess(res);
              return;
          }
  
          let rangeError = false;
          let geometries = {};
          sectionsToUpdate.forEach(function (e) {
              const section = sections[e];
              geometries[e] = { x: section.x, y: section.y, w: section.w, h: section.h };
              let space;
              if (operation.moveTo && operation.moveTo.space) {
                  space = operation.moveTo.space;
              } else {
                  space = Object.keys(section.spaces)[0];
              }
              const bounds = _getSpaceGeometries()[space];
              if (operation.transform) {
                  if (operation.transform.scale) {
                      geometries[e].w = (geometries[e].w * operation.transform.scale.x) << 0;
                      geometries[e].h = (geometries[e].h * operation.transform.scale.y) << 0;
                  }
                  if (operation.transform.translate) {
                      geometries[e].x = (geometries[e].x + operation.transform.translate.x) << 0;
                      geometries[e].y = (geometries[e].y + operation.transform.translate.y) << 0;
                  }
              }
              if (geometries[e].x < 0 || geometries[e].y < 0 || Math.max(geometries[e].x, geometries[e].w) > bounds.w || Math.max(geometries[e].y, geometries[e].h) > bounds.h) {
                  log.error('Section no longer fits within space after transformation for section id:', e, 'space:', space, 'geometry:', JSON.stringify(geometries[e]));
                  rangeError = true;
              }
          });
          if (rangeError) {
              log.error('Unable to update sections due to one or more range errors');
              Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid dimensions' }));
              return;
          }
  
          sectionsToUpdate.forEach(function (e) {
              const section = sections[e];
              let space;
              if (operation.moveTo && operation.moveTo.space) {
                  space = operation.moveTo.space;
              }
              _updateSectionById(e, space, geometries[e], section.app);
          });
          if (sectionsToUpdate.length === server.state.get('sections').length) {
              log.info('Successfully updated all sections');
          } else {
              log.info('Successfully updated sections:', sectionsToUpdate);
          }
          Utils.sendMessage(res, HttpStatus.OK, JSON.stringify({ ids: sectionsToUpdate }));
      }