Added function to authenticate users, fixed getDevicesByClientID