Implement filter and state query url

I think this could use lodash to do something like `return _.map(resources, function (item) { return item.id; });` instead of most of the function. It would just need the `if (states) ...` block before it.