Refactor api service and useless files