small unit test refactor to use collection extensions
added validator to check the payload is valid json