beforeSend and afterSend docs