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

Also using a string here might be better.