json handling; closes #19