refactor to accept json as well as google spreadsheet id