Modified ajax functions.