finished api stuff