I should have known all that api work would have to be done in js