Moved some variables.
Renamed Posts controller class.
Added check for the existence of controllers and methods.