Only return each resource once, add tests
0.3.2