Added better and more usefull tests
Added validation to JSON decode