As stated in the title, my sails app GET request to a specific route/controller function returns badRequest with JSON in a dev environment but not in a prod environment. Why is this?

Here is the controller function:

```
    index: function(req, res) {

    async.auto({

        companies: function(cb) {

            User.findOneById(req.session.user.id)
                 .populate('companies')
                 .exec(function(err, user) 
            {

                if(err) {
                    var badRequestData = { error: err };
                    return cb(badRequestData, null);
                } else if(user.companies.length == 0) {
                    var badRequestData = { error: "This user has no associated companies." };
                    return cb(badRequestData, null);
                }

                cb(null, user.companies)

            });

        },

        validateForNullCompanies: ['companies', function(cb, results) {

            var nullCompanies = _.where(results.companies, { stripeAccountId: null });

            if(nullCompanies.length > 0) {
                var badRequestData = { error: "This user needs to authenticate stripe with their company." };
                return cb(badRequestData, null);
            } else {
                return cb();
            }

        }]

    }, function(err, results) {

        if (err) {
            return res.badRequest(err);
        }

        return res.ok();

    });

},

```