```ruby
   !respuesta['error'].present?
```
can be written as

```ruby
   respuesta['error'].blank?
```

But I wanted to use the same pattern in all the exit points.