Refactor: Server: Extract method: guard

Extract the parts where we go:
  if (err) {
    handleError(res, err);
  }