lots of updates to finish implementing api and update php pages to hit it