Files api

Urgh, sorry. Meant to take this bit out of the diff.