Add custom logger support. Refactor response error handling. Clean code to follow reek style guide.

aren't those if conditions here redundant? 
As the instance variable would be nil anyways if for example header[:version] is not set?