moved html generation into here, also updated a couple of the api
handlers