update on api.php and lesson.js