added error handling, created user service