api cleanup; added promise support