Clean up json handling.