almost finished API skeleton