adding transactional sql, json generation on the backend