updated user model logic
added key validation
split client into own object