Implementating match function

mainly moved login into Station model