split facebook function and graph api