fixed files upload payload, added tests