Correct return type for buildApiConstructor