Migration to rails-api