written foundation for Ajax on JavaScript side