refactorized afip request and added some tests