File upload using AngularJS with Rails JSON API