added rest methods for flask
added queries