Rails API and ajax request in Angular