created training service with train method