Added exception if passed an invalid type param
Closes #4964
Added tests for match/multimatch queries with invalid “type” JSON param