First working version
Added JSON processing