refactored controlers and added signup functionality