UserRepository.js now works with promises.