added a diverse API and fixed tests