Rails API for det