back/forward button now works for ajax changes
proper error/success msg in dashboard.

cleaned up the code a little bit as well