Completes api endpoint defs and fixes attachment uploads