rails side of events "api"