node server functionality finally synced with php server