reset show/hide variables in the controllers rather than in the api calls
make the mysql close call on destruct instead of at the end of each function call