Write basecontroller tests and docs closes #40