Refacto api Resource