Move and separate response handling out of request function
Merge pull request #36 from asci/master

Move and separate response handling out of request function