update github sync script and add working api script