changes publish script to work with the api rewrite