Add queries to HTTP API and simplify 'new' action