       return res.status(500).json error: err if err?
       # this is really hacky; should be better way
       result1.children = [result2._id]
+      result1.userHasVotedOn = true
       return res.status(200).json result1
 
 # POST /api/bands/:id/vote


# GET /api/bands
exports.index = (req, res) ->
  pop =
    path: 'children'
    select: 'user_id'
  Band.find().populate(pop).sort(vote_count: 'descending', name: 'ascending').exec(
    (err, result) ->
      return res.status(500).json error: err if err?
      return res.status(200).json result
  )

# GET /api/bands/:id

_ = require 'lodash'
Band = require '../models/band'
Vote = require '../models/vote'

