doc
Added promise functions + test