Moved authenticate into controller and model and into API
Modified tests for baseController