better api support, tentative first step on js