move post get request to factory