fix issue with session not handling errors when response.body is empty