updated Response to handle non-json responses gracefully