phil changed some things
document api stuff