add methods for JSON conversion