Feature apidoc

Merged @vaibhav's work on the feature-apidoc
Restored ```?>``` file endings where was removed.