Restrict users to only get information from building and measurements.

Additionally, allow sorting on uuid and timestamp and apply indexes
while we are there.
Make sure that the valueError exception can be found.
The retrieved IDs when asking about samples from sensor was not sorted.
Make sure to order by timestamp desc.