I think this endpoint can be simplified a bit.

```javascript
OAE.globalAdminRouter.on('post', '/api/user/:tenant/create', function(req, res) {
    var ctx = req.ctx
    if (!ctx.user() || !ctx.user().isGlobalAdmin()) {
        return res.send(401);
    }

    var loginId = new LoginId(req.params.tenantAlias, AuthenticationConstants.providers.LOCAL, req.body.username, { password: req.body.password });

    var opts = {
        'visibility': req.body.visibility,
        'email': req.body.email,
        'locale': req.body.locale || req.ctx.locale(),
        'timezone': req.body.timezone,
        'publicAlias': req.body.publicAlias,
        'acceptedTC': (req.body.acceptedTC === 'true'),
        'tenantAlias': req.params.tenantAlias
    };

    AuthenticationAPI.createUser(ctx, loginId, req.body.displayName, opts, function(err, newUser) {
        if (err) {
            return res.send(err.code, err.msg);
        }
        res.send(201, newUser);
    });
});
```