modified layout and fixed apicontroller