Fix indentation
Add ::return_json method & tests
Incorporate return_json method
Merge branch 'refactoring'