model deta and ajax functions add