Changed models + added start of web API

Quick/dirty PHP/MySQL API. Should be good enough for now.