Update files endpoint to new structure