Fix defined? call

- Change db url to /departures/..
- Make use of each_with_index