generalize exceptions on get_{question,trial}_data

fails gracefully when there's a null entry in the database.