Would it make sense to return datatypes for the primitive types here (string, int, etc)? Otherwise is this function is meant to be json only, it should probably be named as such.