Added http_not_found status code
Properly handled emtpy database queries & http response codes