Refactoring response handling
Merge pull request #5 from wagnert/master

Refactoring response handling