support nested resources, close #4