Fix issue where response is not ok in handle_response

Fixes GH-14