'Trying harder' by returning JSON, rather than a map

Since the whole metadata object still needs to be written to the database, simply doing what was done in the previous commit doesn't cut it.