Fixed error handling and content type in requests
Removed encoding from content-type