Fixed the template path and added the ami method