Implement files resource for API. Part of #533