Bug fixed + unit tests

index is update on patient update.
start working on unit tests
some changes on patient controller
fixed bug

not searching yet. sorry for commiting on your branch, I'm merging to
mine and will continue there.