Creating rails api