Refactor api into separate module from html functionality; Adds some stubs for image features I'm working on