Added better error handling for missmatched nested resources