Update ajax calls to database