Why dont you simply use already MS api:
[login to view URL]
put in JSON: {"signInName":"testr @ [login to view URL]"}
and you will get return status of email :
{"error":{"code":"1058","data":"","stackTrace":""}}
or if available then you will receive:
{"apiCanary":"8yOFrI54CyfuygCNGybbCtWv4jobBMtcu64a6WjEQva7WvqbAR3pxzZ61Xnxm7XO+rR4C7hFyzpOiJJuHArW87\/DsKwadeMPN1zQ65JxUH9wYKJRbTKfx9CcSOInd56k1HjR3NfA+qj3GscVvfRKRwJnRzto9gCP27y03\/mEl2NUdS6WjKHIL0jP3osov9GQvWSEkxkK82wYQljQwW9LWkOkGHvIvCwf\/1Em4MgyvhjusRKcDJ0F6m6uHCj+BpjP:1:3c","isAvailable":true,"isLive":true}
Simple as that. You can call it wil jquery ajax or call php script that with CURL calls this API. I hope i helped.