Authentication through devise...finally

I finally managed to get devise to work with rails-api. Devise is a gem that provides authentication and is usually done through HTML views. I managed to get it to work with JSON only after some annoying attempts by overriding the session creation and destroying. 

If anyone has any comments on this or improvements let me know as this is the first time I've used this gem with a JSON API.