switching backend from php to js