Using content-type for choosing the viewer instead of extension

I used a AJAX request to get the content-type of the file, in this way
we can use viewer.js with REST services.