More work on rails-api porting