use Rails as an API