Handled filtering when invalid JSON is passed - inc unit test