code refactoring and add test on valid json and invalid json
Merge pull request #4 from weblancaster/development

code refactoring and add test on valid json and invalid json