api fixes and new features

added related support
began fixing line endings
template fixes