Update API(JS and PHP) to apply the new changes on new table structure