Added the first version of the server API

This API is still an early version, I'll make it more efficient later and add description of the functions in the file.