updated to api instead of iframe