made database class static
added database level handling
response for error handling
new style pupil endpoint
for php strict
more php strict