adding response generation, error response unfinished