api/app: refactoring some duplicate code
api/app: refactoring some duplicate code

ggarnier/tsuru,kgrvamsi/tsuru,gwmoura/tsuru,tuxmonteiro/tsuru,hugoantunes/tsuru,4eek/tsuru,gciotta/tsuru,cgvarela/tsuru,cezarsa/tsuru,gwmoura/tsuru,hcxiong/tsuru,guilhermebr/tsuru,cgvarela/tsuru,firebitsbr/tsuru,jblancett/tsuru,cezarsa/tsuru,gciotta/tsuru,kgrvamsi/tsuru,kgrvamsi/tsuru,gciotta/tsuru,hcxiong/tsuru,RichardKnop/tsuru,cezarsa/tsuru,hugoantunes/tsuru,ggarnier/tsuru,Endika/tsuru,guilhermebr/tsuru,guilhermebr/tsuru,4eek/tsuru,ggarnier/tsuru,tsuru/tsuru,mderaldo/tsuru,ArxdSilva/tsuru,ArxdSilva/tsuru,ArxdSilva/tsuru,firebitsbr/tsuru,ggarnier/tsuru,4eek/tsuru,RichardKnop/tsuru,cgvarela/tsuru,gwmoura/tsuru,ArxdSilva/tsuru,mderaldo/tsuru,tuxmonteiro/tsuru,hcxiong/tsuru,tsuru/tsuru,Endika/tsuru,cezarsa/tsuru,tsuru/tsuru,guilhermebr/tsuru,tsuru/tsuru,mderaldo/tsuru,jblancett/tsuru,jblancett/tsuru,firebitsbr/tsuru,Endika/tsuru,RichardKnop/tsuru,tuxmonteiro/tsuru