Fixed JSON errors

and restructured CMakeLists a little.