Added controller methods and tests