front end connects with rails api