async function addEventsHandler(req, res) {
  try {
    const data = [];
    req.on('data', (chunk) => {
      data.push(chunk);
    });
    req.on('end', async () => {
      await database.addToServer(JSON.parse(data).entry);
      res.statusCode = 200;
      res.end();
    });
  } catch {
    res.statusCode = 401;
    res.end();
  }
}
Handler for an events POST request. Add an entry to the database.
@param {!Object} req The HTTP request object.
@param {!Object} res The HTTP response object.
@private