Add a few comments
fix some error messages
logic to handle hash for nested or multiple resources