creating rails api and layout