Adding check for content-type header

This fixes #1069 but I think there may be a deeper error that may need attention and may make this somewhat irrelevant. Also, if checking Content-Type like this is desired here there are probably several other places it should be applied in api.go.