Fixed imports and formatting
Fixed JSON emitting code