Updated api + added documentation