Prevent key error when ['files'] doesn't exist

This happens when triggered from Api.