Add permissions to trend API controller.
Remove undefined error message.
View source
Tidy up view source

Note: I created a filter to allow us to handle dates in a standardized
way throughout the app. Ideally we'd be doing this with i18n, but I
haven't looked into how to do this with Angular and I saw an open ticket
for it, so will revisit date formats later.