Add message on frontend and allow for missing trip data/frequency data

Might it get an out-of-range error for the index or length?  It may be safer to use [`substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) instead of `substr`, in that case, or omit the length, if there's nothing after the number to extract.