moved saveuser function from controllers to the service