JAVASCRIPT+PHP - API INTRFACE