adding rails-api gem and setting up application controller