switch to rails api. still works