Update API Wrapper and JS handling to the new metadata format