Added content type parsing and fixed #2