Adding a data factory to handle all rest api calls