Better management of errors and situations where no trains are returned by the APIs