related to issue #17; changed methods http responses and output based on 'Content-Type' header