Added test for Facebook service and fixed some bugs