added error checking of qp default value
proper http response and message on error