fixed query download layer

1. added json message
2. added validation