The javascript is very inconsistent between pages. I'm trying to start using a consistent pattern where the api call is kept in a separate function from the ones that buttons and input boxes talk to.