Created factory resource to get data from api