Use require_POST decorator and reorganize imports.