Fixed formating and updated test

- fixed error where space put in string while formatting json
- updated Testing with a more detailed output of what is happening