Fix bugs in sell controller and start work on sell template