Add json parsing. Clean up.