improved resource providing through web api, added viewer functionality.