fixed #224: returning 404 for invalid record ids