added TypeScript Definition File generation for services
fixed some bugs