docs: function (req, res) {
          if (!req.body.space || !server.spaces[req.body.space]) {
              log.error('Invalid Space', 'request:', JSON.stringify(req.body));
              Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid space' }));
              return;
          } else if (req.body.w === undefined || req.body.h === undefined || req.body.x === undefined || req.body.y === undefined) {
              // specifically testing for undefined since '0' is a valid input.
              log.error('Invalid Dimensions', 'request:', JSON.stringify(req.body));
              Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid dimensions' }));
              return;
          } else if (req.body.app && !req.body.app.url) {
              log.error('Invalid App Configuration', 'request:', JSON.stringify(req.body.app));
              Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid app configuration' }));
              return;
          }
          let section = { w: req.body.w, h: req.body.h, x: req.body.x, y: req.body.y, spaces: {} };
          section.spaces[req.body.space] = _calculateSectionLayout(req.body.space, {
              x: req.body.x, y: req.body.y, w: req.body.w, h: req.body.h
          });
          log.debug('Generated spaces configuration for new section');
  
          // Deploy an App into a section
          let sectionId = server.state.get('sections').length;
          if (req.body.app) {
              const url = req.body.app.url.replace(/\/$/, '');
              section.app = { 'url': url };
              log.debug('Got URL for app:', url);
              if (req.body.app.states) {
                  /* istanbul ignore else */
                  // DEBUG logging is turned on by default, and only turned off in production deployments.
                  // The operation of the Constants.Logging.DEBUG flag has been tested elsewhere.
                  if (Constants.Logging.DEBUG) {
                      log.debug('Got state configuration for app:', JSON.stringify(req.body.app.states));
                  }
                  // Cache or load states if they were provided as a part of the create request.
                  if (req.body.app.states.cache) {
                      Object.keys(req.body.app.states.cache).forEach(function (name) {
                          log.debug('Caching new named state for future use:', name);
                          request.post(section.app.url + '/states/' + name, {
                              headers: { 'Content-Type': Constants.HTTP_CONTENT_TYPE_JSON },
                              json: req.body.app.states.cache[name]
                          }, _handleRequestError);
                      });
                  }
                  if (req.body.app.states.load) {
                      // Either a named state or an in-line state configuration can be loaded.
                      if (typeof req.body.app.states.load === 'string' || req.body.app.states.load instanceof String) {
                          section.app.state = req.body.app.states.load;
                          log.debug('Loading existing named state:', section.app.state);
                      } else {
                          log.debug('Loading state configuration');
                          request.post(section.app.url + '/instances/' + sectionId + '/state', {
                              headers: { 'Content-Type': Constants.HTTP_CONTENT_TYPE_JSON },
                              json: req.body.app.states.load
                          }, _handleRequestError);
                      }
                  }
              }
              const opacity = req.body.app.opacity;
              if (opacity) {
                  log.debug('Setting opacity for app:', opacity);
                  section.app.opacity = opacity;
              }
          }
          server.state.set('sections[' + sectionId + ']', section);
  
          // Notify OVE viewers/controllers
          server.wss.clients.forEach(function (c) {
              if (c.readyState === Constants.WEBSOCKET_READY) {
                  // Sections are created on the browser and then the application is deployed after a
                  // short delay. This will ensure proper frame sizes.
                  c.safeSend(JSON.stringify({ appId: Constants.APP_NAME,
                      message: { action: Constants.Action.CREATE, id: sectionId, spaces: section.spaces } }));
                  if (section.app) {
                      setTimeout(function () {
                          c.safeSend(JSON.stringify({ appId: Constants.APP_NAME,
                              message: { action: Constants.Action.UPDATE, id: sectionId, app: section.app } }));
                      }, Constants.SECTION_UPDATE_DELAY);
                  }
              }
          });
          log.info('Successfully created new section:', sectionId);
          log.debug('Existing sections (active/deleted):', server.state.get('sections').length);
          Utils.sendMessage(res, HttpStatus.OK, JSON.stringify({ id: sectionId }));
      }