/**
 * @package admiral
 * @author Andrew Munsell <andrew@wizardapps.net>
 * @copyright 2015 WizardApps
 */

exports = module.exports = function(app, config, fleet) {
    /**
     * Get the machines in the cluster
     */
    app.get('/v1/machines', function(req, res) {
        fleet.list_machinesAsync()
            .then(function(machines) {
                res
                    .json(machines)
                    .header('Cache-Control', 'private, max-age=60');
            })
            .catch(function(err) {
                res
                    .status(500)
                    .json({
                        error: 500,
                        message: 'There was a problem fetching the machines.'
                    });
            })
            .finally(function() {
                res.end();
            });
    });
};

exports['@singleton'] = true;
exports['@require'] = ['app', 'config', 'fleet'];
@@ -362,44 +362,8 @@
 res%0A
-                    .json(machines)%0A
     
@@ -425,16 +425,52 @@
 age=60')
+%0A                    .json(machines)
 ;%0A      

Fix order of headers in response