Middleware now responds with status 400 if the property is not defined in the request
Added some test cases