Implement filter and state query url

Better to use `_.each(states, function (entry) { ...` since it is less error-prone than manually iterating.