updated api functionality and tests