Add edit and new functions and corresponding templates