added devise and tests