change api generator to generate files is api directory, use instance names to register services