Add documentation and small fixes
fix javascript type