Implemented connection to firebase backend as a factory