Fixed php & javascript restApi issue