JSON marshal: use generic marshalling methods