$_FILES['files']['error'] returns error code along with the file array. There are different type of error codes, all codes are mentioned in following link with details:
Please check by
and see what are you getting in response.
As you posted your array response, you can get error code by $_FILES['files']['error'] or use switch case as mentioned in following link.
See here for more details: http://php.net/manual/en/features.file-upload.errors.php
Also regarding debugging, always debug code step by step from top to bottom. Check $_POST, $_FILES, $_SERVER etc details if you get some problem particular related to data process.