Add schema validation to measurements API.

When we read the body in index-malformed? we put it back into the ctx. Otherwise data is lost. The request body can only be read once.