handles non-JSON responses too