Some bugs fixed and added support for the api to query only for a list of given fields

Signed-off-by: Thomas Spycher <tspycher@zerodine.com>