Added documentation for promises and queries