Moved some files to web/api. Documented code.