allow for handling non-json responses
Merge branch 'rewrite'