I develop a consistent nonparametric local rank test to study demand systems with many commodities. The test is applied to the China Living Standard Survey data and suggests that rank two demand models are sufficient for the data. However, the estimated nonparametric budget share Engel curves indicate that the popular rank two Almost Ideal Demand System has incorrect specification of price effects. This is the consequence of its misspecified PIGLOG cost function, no matter it is locally or globally flexible. To solve the misspecification problem, I propose a new reverse demand modeling strategy. Rather than deriving budget share equations from a cost functionusing Shepard‘s Lemma, I model the response of budget shares to pricesnonparametrically and then recover the PIGLOG cost function from the estimatednonparametric budget share Engel curves. The reverse modeling strategy can generate ademand model that is consistent with both demand theory and the data under study.