Updating api, to handle more session errors