V3 api rails

This drops Sinatra as the framework for the API and moves the API to just use native Rails.