adds account_id and timestamp to query