Added types and more js methods