First thing, make sure the login is with the scope "email address"
FB.login(function(response) {
// handle the response
}, {scope: 'email'});
Testapi function will first get the email address of the current user. And response will contain the email address. You should have a service which 'retrieves' email address from the front end, check in the db whether the email address is already existing and 'return' response (may be as simple as 'yes' or 'no')
function testApi(){
FB.api('/me', function(response) {
$.ajax({
type: 'GET',
url: "service/isEmailExisting?email="+response.email,
success:function(data){
alert(data);
}
});
});
}