remove redundant http check in ajax functions