Storing location objects and returning an object instead of just an ID

I think most people would expect the locations array first (and may not even care about the metadata). It is worth changing. Ask Kevin.