JSON encoding with encoding/json for all objects