Using Rails to do API